<template>
  <ul class="news-list">
    <li>编号：{{ params.id }}</li>
    <li>标题：{{ params.title }}</li>
    <li>内容：{{ params.content }}</li>
  </ul>
</template>

<script setup lang="ts">
import { toRefs } from 'vue'
import { useRoute } from 'vue-router'

let route = useRoute()
// 从响应式对象中解构对象
// 注意，如果希望解构出来的对象 仍然是响应式的，需加上 toRefs
let { params } = toRefs(route)

console.log('@useRoute', route)
</script>

<style scoped>
.news-list {
  list-style: none;
  padding-left: 20px;
}

.news-list > li {
  line-height: 30px;
}
</style>
